package com.yolo.controller.excption;

import com.yolo.util.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * ClassName: HandlerException
 * Description:
 * date: 2021/4/23 11:37
 *
 * @author 须臾
 * @since JDK 1.8
 */
@ControllerAdvice
public class HandlerException {

    private static final Logger log = LoggerFactory.getLogger(HandlerException.class);

//    @ExceptionHandler
//    @ResponseBody
//    public Result handlerException(Exception e){
//        return Result.succ("异常");

//    /**
//     * 基础异常
//     */
//    @ExceptionHandler(RuntimeException.class)
//    public Result baseException(RuntimeException e)
//    {
//        return Result.error(e.getMessage());
//    }
//
//    /**
//     * 业务异常
//     */
//    @ExceptionHandler(RuntimeException.class)
//    public Result businessException(RuntimeException e)
//    {
//        return Result.error(e.getMessage());
//    }
}
